// 版权归 瞄你个汪 所有。使用本代码应遵守相关法律法规和Apache 2.0开源许可要求。
package top.geeke.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import top.geeke.entity.base.EntityBase;
import top.geeke.eunm.SysNoticeStatusEnum;
import top.geeke.eunm.SysNoticeTypeEnum;
import top.geeke.eunm.SysStatusEnum;
import top.geeke.toolkit.supertable.annotation.SuperColumn;
import top.geeke.toolkit.supertable.annotation.SuperIndex;
import top.geeke.toolkit.supertable.annotation.SuperTable;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统通知公告表
 * </p>
 * @author 瞄你个汪
 * @since 2024-05-01 12:00:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_notice")
@SuperTable(value = "系统通知公告表", isSystem = true, indexes = {
        @SuperIndex(indexName ="sys_index_{table}_T", indexFields ="noticeType"),
})
public class SysNotice extends EntityBase implements Serializable {
    private static final long serialVersionUID = 1L;

    @SuperColumn(value = "标题", length = 32)
    private String noticeTitle;

    @SuperColumn(value = "通知公告内容", columType = JdbcType.LONGVARCHAR)
    private String content;

    @SuperColumn(value = "类型(1通知 2公告)")
    private SysNoticeTypeEnum noticeType;

    @SuperColumn(value = "发布人", nullable = true)
    private Long publicUserId;

    @SuperColumn(value = "发布人姓名", length = 32, nullable = true)
    private String publicUserName;

    @SuperColumn(value = "发布机构", nullable = true)
    private Long publicOrgId;

    @SuperColumn(value = "发布机构名称", length = 64, nullable = true)
    private String publicOrgName;

    @SuperColumn(value = "发布时间", nullable = true)
    private LocalDateTime publicTime;

    @SuperColumn(value = "撤回时间", nullable = true)
    private LocalDateTime cancelTime;

    @SuperColumn(value = "状态（0草稿 1发布 2撤回 3删除）")
    private SysNoticeStatusEnum noticeStatus;

    @SuperColumn(value = "状态")
    private SysStatusEnum status = SysStatusEnum.Enabled;

    @SuperColumn(value = "排序", defaultValue = "100")
    private Integer orderNo = 100;

    @SuperColumn(value = "备注", nullable = true, length = 128)
    private String remark;

    @JsonIgnore
    @JsonIgnoreProperties
    @TableField(exist = false)
    private SysUser publicUser;

    @JsonIgnore
    @JsonIgnoreProperties
    @TableField(exist = false)
    private SysOrg publicOrg;
}
